﻿using System;
using System.Collections.Generic;
using System.Text;
using ConsoleApp.拦截器;
using System.Linq;

namespace ConsoleApp
{
    public class OrderInterceptBusinessService
    {
        public void Show()
        {
            var orders = DBData.GetOrderMainsDBData();

            var interceptOutputs = GetOrderIntercepts(orders).ToArray();
        }

        public IEnumerable<OrderInterceptOutput> GetOrderIntercepts(IEnumerable<OrderMain> orders)
        {
            var inputFactory = new OrderInterceptInputFactory();
            var contextFactory = new OrderInterceptContextFactory();

            var inputs = inputFactory.GetList(orders);
            var handler = new OrderInterceptHandler();
            var outputs = handler.InterceptOrders(inputs, contextFactory);
            
            return outputs;
        }


    }




}
